package day08;

import java.util.ArrayList;

public class ArrayList01 {
    public static void main(String[] args) {                    //添加手机对象并返回数据
        PhoneBean pb=new PhoneBean();
        ArrayList<PhoneBean> list=new ArrayList<>();
        list.add(new PhoneBean("小米",1000));
        list.add(new PhoneBean("苹果",8000));
        list.add(new PhoneBean("锤子",2999));
    }

    public static ArrayList<PhoneBean> lessThan3000(ArrayList<PhoneBean> inf) {
        ArrayList<PhoneBean> result=new ArrayList<>();
        for (int i = 0; i < inf.size(); i++) {
            if (inf.get(i).getPrice()<3000){
                result.add(inf.get(i));
            }
        }
        return result;
    }
}
